package cn.iocoder.yudao.module.book.service.app;

import cn.iocoder.yudao.module.book.controller.app.vo.AppBookShelfRespVO;
import cn.iocoder.yudao.module.book.dal.dataobject.bookshelfcatalogue.BookShelfCatalogueDO;
import cn.iocoder.yudao.module.book.dal.mysql.bookshelfcatalogue.BookShelfCatalogueMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppBookShelfCatalogueServiceImpl implements AppBookShelfCatalogueService {

    @Resource
    private BookShelfCatalogueMapper bookShelfCatalogueMapper;

    @Override
    public List<BookShelfCatalogueDO> getBookShelfAllList(Long type) {
        LambdaQueryWrapper<BookShelfCatalogueDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(BookShelfCatalogueDO::getType, type);
        return bookShelfCatalogueMapper.selectList(queryWrapper);
    }

    @Override
    public List<AppBookShelfRespVO> getBookShelf(String type, Long id) {

        return bookShelfCatalogueMapper.selectBookShelfByType(type, id);
    }
}
